/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

import { Request, Response } from 'express';
import { responseSuccess } from '../utils';
import Mock from 'mockjs';

export default {
  'POST /ProductHelpCollection/list': (req: Request, res: Response) => {
    const data = Mock.mock({
      'list|1-10': [
        {
          id: '@id()',
          title: '@cname(7)',
          content: 'sad两个接口拉屎噶考虑到公司打开了房间<img>',
          'category|1': ['快递员端', '驿站端', ''],
          tag: ['驿站代收', '出入库', '取件码', '短信', '隐私面单'],
          'top|1': ['1', '0'],
          'status|1': ['1', '0'],
          'read_count|1-1000': 1000,
          'is_deleted|1': ['1', '0'],
          create_time: '@now',
          update_time: '@now',
          picture: 'http://img.kuaidihelp.com/ad/wdadmin/top-topic.png',
        },
      ],
    });
    const result = {
      code: 0,
      msg: 'success',
      data: {
        list: data.list,
        count: 99,
      },
    };
    return res.json(result);
  },
  'POST /ProductHelpCollection/tagList': (req: Request, res: Response) => {
    return res.json({
      code: 0,
      msg: 'success',
      data: [
        '驿站代收',
        '出入库',
        '取件码',
        '短信',
        '隐私面单',
        '共配',
        '巴枪',
        '电子面单',
        '查寄快递',
        'API',
        '电商导入',
        '微商打单',
        '快递柜',
        '打印机',
        '出库仪',
        '扫码寄',
      ],
    });
  },
  'POST /ProductHelpCollection/detail': (req: Request, res: Response) => {
    const result = {
      code: 0,
      msg: 'success',
      data: Mock.mock({
        id: '@id()',
        title: '@cname(7)',
        content: 'sad两个接口拉屎噶考虑到公司打开了房间<img>',
        'category|1': ['0', '1', '2', '3', '4', '5', '6', '7', '8'],
        tag: ['驿站代收', '出入库', '取件码', '短信', '隐私面单'],
        'top|1': ['1', '0'],
        'status|1': ['1', '0'],
        'read_count|1-1000': 1000,
        'is_deleted|1': ['1', '0'],
        create_time: '@now',
        update_time: '@now',
        picture: 'http://img.kuaidihelp.com/ad/wdadmin/top-topic.png',
      }),
    };
    return res.json(result);
  },
  'POST /Inn/essayTop': (req: Request, res: Response) => responseSuccess(req, res),
  'POST /ProductHelpCollection/publish': (req: Request, res: Response) => responseSuccess(req, res),
  'POST /ProductHelpCollection/delete': (req: Request, res: Response) => responseSuccess(req, res),
  'POST /ProductHelpCollection/addTag': (req: Request, res: Response) => responseSuccess(req, res),
  'POST /ProductHelpCollection/delTag': (req: Request, res: Response) => responseSuccess(req, res),
  'POST /ProductHelpCollection/edit': (req: Request, res: Response) => responseSuccess(req, res),
};
